import Mock from 'mockjs'

export default [
    //获取验证码
    {
        url: '/common/vcode',
        type: 'post',
        response: config => {
            // console.log('获取验证码:', config)
            const { mobile } = config.body
            if (mobile.length != 11) {
                return {
                    code: 201,
                    data:null,
                    message: '手机号格式不正确.'
                }
            }
            const vcode = Mock.mock({
                'vcode': /[0-9]{6}/
            });
            return {
                code: 200,
                message: '验证码获取成功',
                data: vcode
            }
        }
    }
]
